﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class zxgl_HmFenBu : System.Web.UI.Page
{
    public ArrayList LotteryArrayList = null;//过滤后，投注号码串
    public int[] redCount = new int[34];
    public int[] blueCount = new int[17];
    string[] ball = null;
    public double redAvgData = 0;//红球平均累计值
    public double blueAvgData = 0;//蓝球平均累计值
    int redMaxData = 0;//红球数组中最大值
    int blueMaxData = 0;//蓝球数组中最大值
    protected void Page_Load(object sender, EventArgs e)
    {
        LotteryArrayList = BLL.ArrayListClass.GetArrayList();
        for (int i = 0; i < LotteryArrayList.Count; i++)
        {
            ball= LotteryArrayList[i].ToString().Split(',');
            for (int j = 0; j < ball.Length; j++)
            {
                if (j < ball.Length - 1)
                {
                    redCount[Convert.ToInt32(ball[j])]++;//红球个数
                }
                else
                {
                    blueCount[Convert.ToInt32(ball[j])]++;//蓝球个数
                }
            }
        }
       
        for (int t = 0; t < redCount.Length; t++)
        {
            
                if (redMaxData < Convert.ToInt32(redCount[t]))//取出红球数组中的最大值
                {
                    redMaxData = Convert.ToInt32(redCount[t]);
                }
        }
        for (int m = 0; m < blueCount.Length; m++)
            {
            if (blueMaxData < Convert.ToInt32(blueCount[m]))//取出红球数组中的最大值
            {
                blueMaxData = Convert.ToInt32(blueCount[m]);
            }
        }
        redAvgData = (double)100/ redMaxData;
        blueAvgData = (double)80 / blueMaxData;
    }
}